package com.mgvlife.ddlw.dao;

import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.mgvlife.ddlw.entity.Schedule;
import com.xinhuo.dao.DaoSupport;
import com.xinhuo.exception.DaoException;
import com.xinhuo.util.DateUtil;

//@Component("userDao")
/**
 * @author mrsimple
 * @date 2015-2-12
 */
public class DaoSupportExtra extends DaoSupport {

	/**
	 * @param clazzTime
	 * @return
	 * @throws DaoException
	 */
	@SuppressWarnings("unchecked")
	@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
	public boolean getScheCount(String clazzTime) throws DaoException {
		String hql = "from Schedule as sd where sd.clazzTime =:cTime";
		String[] params = { "cTime" };   
		Object[] args = { DateUtil.format(clazzTime) };   
		List<Schedule> list = this.hibernateTemplate.findByNamedParam(hql, params, args);
		return list.size() > 0;
	}
	
	
	
}
